(The overall Attack power, seen in the STAT menu, is the sum of two parts:
 - A constant based on the character's level, which is already in variable $0A3F.
 - The weapon's battle power, with a 25% bonus for swords if you have Silver Sheath.)

[... more of function]

-------  Everything up until next dotted line is identical to original Square code. ------

8F/845B: AE BA 0A     LDX $0ABA     (Unique index of weapon held)
8F/845E: F0 54        BEQ $84B4     (if we're empty handed, skip all this)
8F/8460: E0 1A 00     CPX #$001A    (is it a Bazooka?)


------------------  This next jump is adjusted for reduced code. -------------------------

8F/8463: D0 1D        BNE $8482     (if not, branch)


-------  Everything up until next dotted line is identical to original Square code. ------

8F/8465: AD 3F 0A     LDA $0A3F     (get our level-based attack modifier)

8F/8468: 18           CLC
8F/8469: 69 12 00     ADC #$0012    (give 18 Battle Power to bazooka as a bludgeon)
8F/846C: 8D 68 14     STA $1468
8F/846F: AF 49 23 7E  LDA $7E2349   (type of Bazooka shell currently loaded)
8F/8473: 29 FF 00     AND #$00FF    (just look at bottom 8 bits)
8F/8476: AA           TAX
8F/8477: BF 8E 38 C4  LDA $C4388E,X   (get a 16-bit pointer to this ammo's Battle Power)
8F/847B: AA           TAX
8F/847C: BF 00 00 C4  LDA $C40000,X   (get the Battle Power)


----------- Region up to next dotted line consists of my significant changes: ------------
----------- optimizations and the added Silver Sheath check. -----------------------------

8F/8480: 80 2D        BRA $84AF       (note it will overwrite the level-based attack modifier
                                       rather than adding to it)


8F/8482: DA           PHX             (save index for later)

8F/8483: BF 74 38 C4  LDA $C43874,X   (get a 16-bit pointer to weapon's Battle Power)
8F/8487: AA           TAX
8F/8488: BF 00 00 C4  LDA $C40000,X   (get the Battle Power)
8F/848C: 85 12        STA $12         (save the Battle Power)

                                      (Variable $0012 will a hold different value than in the
                                       original Square code, but it gets overwritten later in
                                       the function anyway.)

8F/848E: 18           CLC
8F/848F: 6D 3F 0A     ADC $0A3F
8F/8492: 8D 3F 0A     STA $0A3F       (add it to our level-based Attack modifier)

8F/8495: FA           PLX             (read unique weapon index again)

8F/8496: BF DC 59 C4  LDA $C459DC,X   (weapon type?  Sword = 0, Axe = 2,
                                       Spear = 4, Bazooka = 6)
8F/849A: C9 00 00     CMP #$0000   (is it a sword?

                                    this instruction can be scrapped, but i'm leaving it in for
                                    the off chance that some patch maker wants to replace Silver
                                    Sheath with a boost for another weapon -- e.g. the
                                    "Golden Spear Case" or "Titanium Groundskeeper Willie's Back")
8F/849D: D0 15        BNE $84B4    (if not, branch)

8F/849F: AD 62 22     LDA $2262
8F/84A2: 89 40 00     BIT #$0040   (is Silver Sheath possessed?)
8F/84A5: F0 0D        BEQ $84B4    (branch if not)

8F/84A7: A5 12        LDA $12      (get the weapon Battle Power again)


---------  The remainder of the code shown is identical to the original function, aside -----------
---------  from being shifted and having those beautiful NOPs. ------------------------------------

8F/84A9: 4A           LSR
8F/84AA: 4A           LSR          (divide by 4)

8F/84AB: 18           CLC
8F/84AC: 6D 3F 0A     ADC $0A3F

8F/84AF: 8D 3F 0A     STA $0A3F    (Swords end up with 5/4 Battle Power added to our level-based value)

(At this point, $0A3F will hold the Attack stat, although the Bazooka may revert to the value
 in $1468 if it runs out of shells or it's used when it's not charged yet.)

8F/84B2: EA           NOP
8F/84B3: EA           NOP

[more of function...]
